//
//  CZPublishController.swift
//  GZWeibo007
//
//  Created by demon on 15/12/24.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

class CZPublishController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "发表说说"
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "关闭", style: UIBarButtonItemStyle.Plain, target: self, action: "close")
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "发表说说", style: UIBarButtonItemStyle.Plain, target: self, action: "publishAttitude")
        inputTextField.backgroundColor = UIColor.orangeColor()
        prepareUI()
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    func prepareUI()
    {
        self.view.addSubview(inputTextField)
        
        inputTextField.translatesAutoresizingMaskIntoConstraints = false
        
        self.view.addConstraint(NSLayoutConstraint(item: inputTextField, attribute: NSLayoutAttribute.Left, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Left, multiplier: 1, constant: 0))
        self.view.addConstraint(NSLayoutConstraint(item: inputTextField, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: inputTextField, attribute: NSLayoutAttribute.Top, multiplier: 1, constant: 0))
        self.view.addConstraint(NSLayoutConstraint(item: inputTextField, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: UIScreen.mainScreen().bounds.size.width))
        self.view.addConstraint(NSLayoutConstraint(item: inputTextField, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem:nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: UIScreen.mainScreen().bounds.size.height))
    }
//MARK: -左右边按钮的点击事件v
    func close()
    {
        dismissViewControllerAnimated(false, completion: nil)
    }
    func publishAttitude()
    {
        
    }
    //懒加载文本框
    lazy var inputTextField: UITextField = UITextField()
}